package com.ftg.shopping.login.controller;

import com.ftg.shopping.config.LayuiPage;
import com.ftg.shopping.login.service.loginService;
import com.ftg.shopping.person.entity.sp_personinfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@Api(description = "登陆")
@RequestMapping("/api/login")
public class loginController {

    @Autowired
    loginService loginService;

    @ApiOperation("这是登陆功能")
    @PostMapping("/login")
    LayuiPage<sp_personinfo> login(sp_personinfo spp){
        return loginService.login(spp);
    }


    @ApiOperation("这是一级目录")
    @GetMapping ("/showForPara1")
    public LayuiPage showForPara1(int userid){
        return loginService.showForPara1(userid);
    }

    @ApiOperation("这是二级目录")
    @PostMapping("/showForPara2")
    public LayuiPage showForPara2(int id,int userid){
        return loginService.showForPara2(id,userid);
    }

    @ApiOperation("这是显示欢迎***登陆")
    @PutMapping("/getPersonName")
    public Map<String,Object> getPersonName(String userid){
        return loginService.getPersonName(userid);
    }

}
